package ru.yermak.spring;

import java.awt.event.ActionEvent;
import java.util.Map;
import java.util.HashMap;

/**
 * User: harrier
 * Date: Nov 16, 2008
 */
public class ScopedActionEvent extends ActionEvent {

    private Map<String, Object> attributes = new HashMap<String, Object>();


    public ScopedActionEvent(ActionEvent e) {
        super(e.getSource(), e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers());
    }

    Object getAttribute(String name) {
        return attributes.get(name);
    }

    void setAttribute(String name, Object value) {
        attributes.put(name, value);
    }

    Object removeAttribute(String name) {
        return attributes.remove(name);
    }
}